﻿using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

namespace WinUITest.Pages
{
    [Menu("VisualState")]
    public sealed partial class VisualStatePage : Page
    {
        private bool useTestState = false;
        public VisualStatePage() => InitializeComponent();

        private void TestButton_Click(object sender, RoutedEventArgs e)
        {
            if (!useTestState)
            {
                if (VisualStateManager.GoToState(this, "TestState", true))
                {
                    useTestState = true;
                }
            }
            else
            {
                if (VisualStateManager.GoToState(this, "Normal", true))
                {
                    useTestState = false;
                }
            }
        }
    }
}
